<template>
  <view class="content" style="background: #78ffc3; padding: 20rpx; margin: 20rpx;">
    <text style="font-size: 50rpx;">子组件A</text>
    <view class="coma_box">
      <text>父组件传进来的值: </text>
      <text style="font-weight: bold; color: skyblue;">{{ intent }}</text>
    </view>
    <button type="primary" @click="sendData()">传值给CompB组件</button>
  </view>
</template>

<script>
export default {
  props: ['intent'], 
  methods: {
 
    sendData() {
      console.warn('----ComA----sendData----->' + this.intent)
    
      uni.$emit('getIntent', this.intent)
    }
  }
}
</script>

<style>
.coma_box {
  margin: 20rpx 0;
}
</style>